 <?php 
header("Content-type: text/html; charset=UTF-8");
 
 $sql = "SELECT
            
 			coor,
            label
        FROM
            map
       ";
        $result = query($sql);
		$json = '{
  					"values": [';
        while ($row = mysql_fetch_object($result)) {
		 
		 	$coor = explode(",", $row->coor);
			$json .= '
						{
							"latitude" : "'.$coor[0].'",
							"longitude" : "'.$coor[1].'",
							"title" : "'.sth($row->label).'"
							
						},';

		}
$json = substr($json,0,-1);
$json .= '
			] 
				}';

echo $json;
?>